#ifndef _GRO_CHECKBOX_H__
#define _GRO_CHECKBOX_H__

#include "GRO_Gui.h"



namespace GRO
{

class Checkbox : public Widget
{
public:
    LinkVar<bool> checked;

    Checkbox();
    Checkbox(const Dimensions& dims);
    Checkbox(const Dimensions& dims, bool value);
    Checkbox(const Dimensions& dims, bool* LinkedVariable);
    virtual ~Checkbox();

    void link(bool* LinkedVariable);
    
    void set(bool Checked);
    void check();
    void uncheck();
    
    virtual void connectBeacon(Widget* widget, Beacon* beacon, const std::string& fn_name, const std::vector<std::string>& args);
    virtual void draw(SDL_Rect* clipRect);

    virtual Widget* findWidget(int mx, int my);
    
    virtual Widget* action(PointerCursor* mouse, ActionEnum actionType);
    virtual Widget* action(NavCursor* nav, ActionEnum actionType);
    
    virtual TiXmlElement* save(TiXmlElement* parent);
    virtual bool load(TiXmlElement* w);
};


}

#endif
